package cn.doit.scala.day03.beans

/**
 * @DATE 2021/12/27/17:32
 * @Author MDK
 * @Version 2021.2.2
 * */
case class Teachers(id: Int, name:String, age:Int, faceValue:Double) extends Ordered[Teachers] {
  override def compare(that: Teachers): Int = {
    if(this.faceValue-that.faceValue==0){
      this.age.compareTo(that.age)
    }else{
      this.faceValue.compareTo(that.faceValue)
    }
  }
}
